<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view>
		<u-tabbar :value="getIndex" :fixed="true" :placeholder="false" :safeAreaInsetBottom="false">
			<u-tabbar-item :text="item.text" :icon="item.icon" @click="click1(item,index)"
				v-for="(item,index) in getTabBar " :key="index"></u-tabbar-item>

		</u-tabbar>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				title: '测试2',
				value1: 2
			}
		},
		onLoad() {
			uni.hideTabBar({
				animation: false
			})
		},
		computed: {
			...mapGetters(['getTabBar', 'getIndex']),
		},
		methods: {
			click1(e, i) {
				console.log('click1', e.path, i);
				this.$store.commit('setIndex', i)
				uni.switchTab({
					url: e.path
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>